package a.f.g;

import a.c.d;
import a.c.e;
import a.c.m;
import a.c.w;
import a.f.mb;
import a.f.o;
import a.f.wc;

class c
  extends mb
{
  private o w;
  private int x;
  private double y = 80.0D;
  
  public double a()
  {
    return this.y;
  }
  
  public void a(double paramDouble)
  {
    this.y = paramDouble;
  }
  
  public boolean b(o paramo)
  {
    return true;
  }
  
  private void a(float[] paramArrayOfFloat1, float[] paramArrayOfFloat2)
  {
    boolean bool = j.c;
    int k = j.b;
    w localw = this.w.v();
    label54:
    label191:
    label197:
    label199:
    do
    {
      if (!localw.e()) {
        break;
      }
      e locale = localw.d();
      int i = locale.f();
      float f = 0.0F;
      d locald = locale.i();
      int j;
      if (locald != null)
      {
        j = locald.e().f();
        if (bool) {
          break label199;
        }
        if (k != 0) {
          break label197;
        }
      }
      do
      {
        if (i < j)
        {
          break label191;
          f += 1.0F;
          paramArrayOfFloat1[(i + j * (j + 1) / 2)] -= 1.0F;
          if (bool) {
            break label163;
          }
          if (k == 0) {}
        }
        else
        {
          if (bool) {
            break label163;
          }
          if (i > j)
          {
            f += 1.0F;
            paramArrayOfFloat1[(j + i * (i + 1) / 2)] -= 1.0F;
          }
        }
        locald = locald.j();
        if (k == 0) {
          break;
        }
        if (bool) {
          break label54;
        }
        locald = locale.h();
        do
        {
          if (locald == null) {
            break label287;
          }
          j = locald.f().f();
          if (k != 0) {
            break;
          }
          if (i < j)
          {
            f += 1.0F;
            paramArrayOfFloat1[(i + j * (j + 1) / 2)] -= 1.0F;
            if (bool) {
              continue;
            }
            if (k == 0) {}
          }
          else
          {
            if (bool) {
              continue;
            }
            if (i > j)
            {
              f += 1.0F;
              paramArrayOfFloat1[(j + i * (i + 1) / 2)] -= 1.0F;
            }
          }
          locald = locald.i();
        } while (k == 0);
        paramArrayOfFloat1[(i + i * (i + 1) / 2)] = f;
        paramArrayOfFloat2[i] = (1 + locale.c() / 3);
        localw.f();
      } while (bool);
    } while (k == 0);
    label163:
  }
  
  private double[][] b(float[] paramArrayOfFloat1, float[] paramArrayOfFloat2)
  {
    boolean bool = j.c;
    int i19 = j.b;
    int i = paramArrayOfFloat2.length;
    float[] arrayOfFloat1 = new float[i];
    int j = i - 1;
    do
    {
      do
      {
        if (j < 0) {
          break;
        }
        if ((!bool) && (i19 != 0)) {
          break label69;
        }
        arrayOfFloat1[j] = ((float)Math.sqrt(paramArrayOfFloat2[j]));
        j--;
      } while (i19 == 0);
    } while (bool);
    label69:
    float[] arrayOfFloat2 = new float[paramArrayOfFloat1.length];
    int k = 0;
    int m = 0;
    do
    {
      if (m >= i) {
        break;
      }
      int n = 0;
      if (n <= m)
      {
        paramArrayOfFloat1[k] /= arrayOfFloat1[m] * arrayOfFloat1[n];
        k++;
        n++;
      }
      for (;;)
      {
        if (!bool) {
          if (i19 == 0)
          {
            if (i19 == 0) {
              break;
            }
            if (bool) {
              continue;
            }
            m++;
          }
        }
      }
    } while (i19 == 0);
    float f1 = 0.0F;
    m = 0;
    int i2;
    label241:
    label245:
    do
    {
      do
      {
        if (m >= i) {
          break;
        }
        float f2 = 0.0F;
        i3 = m * (m + 1) / 2;
        if (i19 != 0) {
          break label333;
        }
        i2 = 0;
        if (i2 < m) {}
        while (bool)
        {
          f2 += Math.abs(arrayOfFloat2[(i2 + i3)]);
          i2++;
          if (bool) {
            break label245;
          }
          if (i19 != 0) {
            break label241;
          }
          if (i19 == 0) {
            break;
          }
        }
        f2 += arrayOfFloat2[(m + i3)];
        i2 = m + 1;
        do
        {
          do
          {
            if (i2 >= i) {
              break;
            }
            f2 += Math.abs(arrayOfFloat2[(m + i2 * (i2 + 1) / 2)]);
            i2++;
            if (bool) {
              break label321;
            }
            if (i19 != 0) {
              break label319;
            }
          } while (i19 == 0);
          if (bool) {
            break;
          }
        } while (bool);
        if (f2 > f1) {
          f1 = f2;
        }
        m++;
      } while (i19 == 0);
    } while (bool);
    label319:
    label321:
    m = 0;
    label333:
    int i1 = 0;
    do
    {
      if (i1 >= i) {
        break;
      }
      if (i19 != 0) {
        break label418;
      }
      i2 = 0;
      if (i2 < i1)
      {
        arrayOfFloat2[m] = (-arrayOfFloat2[m]);
        m++;
        i2++;
      }
      for (;;)
      {
        if (!bool) {
          if (i19 == 0)
          {
            if (i19 == 0) {
              break;
            }
            arrayOfFloat2[m] = (f1 - arrayOfFloat2[m]);
            m++;
            if (bool) {
              continue;
            }
            i1++;
          }
        }
      }
    } while (i19 == 0);
    label418:
    double[] arrayOfDouble1 = new double[i];
    double d1 = 0.0D;
    int i3 = i - 1;
    if (i3 >= 0) {}
    while (bool)
    {
      double d4 = arrayOfDouble1[i3] = arrayOfFloat1[i3];
      if (!bool)
      {
        if (i19 != 0) {
          break label489;
        }
        d1 += d4 * d4;
        i3--;
      }
      if (i19 == 0) {
        break;
      }
    }
    label489:
    double d3 = 1.0D / Math.sqrt(d1);
    int i6 = i - 1;
    do
    {
      do
      {
        if (i6 < 0) {
          break;
        }
        if ((!bool) && (i19 != 0)) {
          break label537;
        }
        arrayOfDouble1[i6] *= d3;
        i6--;
      } while (i19 == 0);
    } while (bool);
    label537:
    double[] arrayOfDouble2 = new double[i];
    double d2 = 0.0D;
    int i4 = i - 1;
    if (i4 >= 0) {}
    while (bool)
    {
      d6 = arrayOfDouble2[i4] = arrayOfFloat1[i4] * Math.abs(Math.random());
      if (!bool)
      {
        if (i19 != 0) {
          break label613;
        }
        d2 += d6 * d6;
        i4--;
      }
      if (i19 == 0) {
        break;
      }
    }
    label613:
    double d5 = 1.0D / Math.sqrt(d2);
    int i8 = i - 1;
    do
    {
      do
      {
        if (i8 < 0) {
          break;
        }
        if ((!bool) && (i19 != 0)) {
          break label661;
        }
        arrayOfDouble2[i8] *= d5;
        i8--;
      } while (i19 == 0);
    } while (bool);
    label661:
    double[] arrayOfDouble3 = new double[i];
    double[] arrayOfDouble4 = new double[i];
    int i5 = 1000;
    label740:
    label742:
    do
    {
      System.arraycopy(arrayOfDouble2, 0, arrayOfDouble3, 0, i);
      double d8 = 0.0D;
      i11 = i - 1;
      do
      {
        do
        {
          if (i11 < 0) {
            break;
          }
          d8 += arrayOfDouble1[i11] * arrayOfDouble2[i11];
          i11--;
          if (bool) {
            break label742;
          }
          if (i19 != 0) {
            break label740;
          }
        } while (i19 == 0);
      } while (bool);
      i11 = i - 1;
      do
      {
        if (i11 < 0) {
          break;
        }
        arrayOfDouble2[i11] -= arrayOfDouble1[i11] * d8;
        i11--;
        if ((!bool) && (i19 != 0)) {
          break label794;
        }
      } while (i19 == 0);
    } while (bool);
    System.arraycopy(arrayOfDouble2, 0, arrayOfDouble4, 0, i);
    label794:
    float f3 = 0.0F;
    int i10 = 0;
    int i11 = 0;
    label803:
    if (i11 < i) {
      i10 += i11;
    }
    int i13;
    label890:
    label894:
    do
    {
      i13 = i10;
      float f5 = 0.0F;
      if (i19 != 0) {
        break;
      }
      i16 = 0;
      do
      {
        do
        {
          if (i16 > i11) {
            break;
          }
          f5 = (float)(f5 + arrayOfDouble4[i16] * arrayOfFloat2[i13]);
          i13++;
          i16++;
          if (bool) {
            break label894;
          }
          if (i19 != 0) {
            break label890;
          }
        } while (i19 == 0);
      } while (bool);
      i13 += i11;
      i16 = i11 + 1;
      if (i16 < i)
      {
        f5 = (float)(f5 + arrayOfDouble4[i16] * arrayOfFloat2[i13]);
        i13 += i16 + 1;
        i16++;
      }
      for (;;)
      {
        if (!bool) {
          if (i19 == 0)
          {
            if (i19 == 0) {
              break;
            }
            arrayOfDouble2[i11] = f5;
            f3 += f5 * f5;
            if (bool) {
              continue;
            }
            i11++;
          }
        }
      }
      if (i19 == 0) {
        break label803;
      }
      d6 = 0.0D;
    } while (bool);
    double d11 = 1.0D / Math.sqrt(f3);
    int i15 = i - 1;
    label1002:
    label1004:
    if (i15 >= 0) {}
    do
    {
      do
      {
        arrayOfDouble2[i15] *= d11;
        d6 += arrayOfDouble2[i15] * arrayOfDouble3[i15];
        i15--;
        for (;;)
        {
          if (i19 == 0) {
            if (!bool)
            {
              if (i19 == 0) {
                break label1002;
              }
              if (bool) {
                break label1004;
              }
              if ((1.0D - d6 > 1.0E-007D) && ((!bool) && (i5-- > 0))) {
                break;
              }
            }
          }
        }
      } while (bool);
    } while (i19 != 0);
    double[] arrayOfDouble5 = new double[i];
    double d6 = 0.0D;
    int i9 = i - 1;
    if (i9 >= 0) {}
    while (bool)
    {
      d10 = arrayOfDouble5[i9] = arrayOfFloat1[i9] * Math.abs(Math.random());
      if (!bool)
      {
        if (i19 != 0) {
          break label1171;
        }
        d6 += d10 * d10;
        i9--;
      }
      if (i19 == 0) {
        break;
      }
    }
    label1171:
    double d9 = 1.0D / Math.sqrt(d6);
    int i12 = i - 1;
    do
    {
      do
      {
        if (i12 < 0) {
          break;
        }
        arrayOfDouble5[i12] *= d9;
        i12--;
      } while (i19 == 0);
    } while (bool);
    int i7 = 1000;
    System.arraycopy(arrayOfDouble5, 0, arrayOfDouble3, 0, i);
    double d10 = 0.0D;
    label1268:
    double d12;
    do
    {
      i13 = i - 1;
      do
      {
        do
        {
          if (i13 < 0) {
            break label1268;
          }
          d10 += arrayOfDouble1[i13] * arrayOfDouble5[i13];
          i13--;
          if (i19 != 0) {
            break;
          }
        } while (bool);
      } while (i19 == 0);
      d12 = 0.0D;
    } while (bool);
    int i16 = i - 1;
    do
    {
      do
      {
        if (i16 < 0) {
          break;
        }
        d12 += arrayOfDouble2[i16] * arrayOfDouble5[i16];
        i16--;
        if (bool) {
          break label1332;
        }
        if (i19 != 0) {
          break label1330;
        }
      } while (i19 == 0);
    } while (bool);
    i16 = i - 1;
    label1330:
    label1332:
    if (i16 >= 0) {}
    while (bool)
    {
      arrayOfDouble5[i16] -= arrayOfDouble1[i16] * d10 + arrayOfDouble2[i16] * d12;
      i16--;
      if ((!bool) && (i19 != 0)) {
        break label1393;
      }
      if (i19 == 0) {
        break;
      }
    }
    System.arraycopy(arrayOfDouble5, 0, arrayOfDouble4, 0, i);
    label1393:
    float f4 = 0.0F;
    i12 = 0;
    label1404:
    do
    {
      int i14 = 0;
      if (i14 < i) {
        i12 += i14;
      }
      double d7;
      do
      {
        i15 = i12;
        float f6 = 0.0F;
        if (i19 != 0) {
          break label1404;
        }
        int i18 = 0;
        do
        {
          do
          {
            if (i18 > i14) {
              break;
            }
            f6 = (float)(f6 + arrayOfDouble4[i18] * arrayOfFloat2[i15]);
            i15++;
            i18++;
            if (bool) {
              break label1493;
            }
            if (i19 != 0) {
              break label1489;
            }
          } while (i19 == 0);
        } while (bool);
        i15 += i14;
        i18 = i14 + 1;
        if (i18 < i)
        {
          f6 = (float)(f6 + arrayOfDouble4[i18] * arrayOfFloat2[i15]);
          i15 += i18 + 1;
          i18++;
        }
        for (;;)
        {
          if (!bool) {
            if (i19 == 0)
            {
              if (i19 == 0) {
                break;
              }
              arrayOfDouble5[i14] = f6;
              f4 += f6 * f6;
              if (bool) {
                continue;
              }
              i14++;
            }
          }
        }
        if (i19 == 0) {
          break;
        }
        d7 = 0.0D;
      } while (bool);
      double d13 = 1.0D / Math.sqrt(f4);
      do
      {
        int i17 = i - 1;
        do
        {
          do
          {
            if (i17 < 0) {
              break;
            }
            arrayOfDouble5[i17] *= d13;
            d7 += arrayOfDouble5[i17] * arrayOfDouble3[i17];
            i17--;
            if (bool) {
              break label1684;
            }
            if (i19 != 0) {
              break label1681;
            }
          } while (i19 == 0);
        } while (bool);
        if ((!bool) && ((1.0D - d7 > 1.0E-007D) && (i7-- > 0))) {
          break;
        }
      } while (bool);
    } while (i19 != 0);
    label1489:
    label1493:
    i7 = i - 1;
    label1681:
    label1684:
    do
    {
      do
      {
        if (i7 < 0) {
          break;
        }
        arrayOfDouble2[i7] /= arrayOfFloat1[i7];
        arrayOfDouble5[i7] /= arrayOfFloat1[i7];
        i7--;
      } while (i19 == 0);
    } while (bool);
    double[][] arrayOfDouble = new double[2][];
    arrayOfDouble[0] = arrayOfDouble2;
    arrayOfDouble[1] = arrayOfDouble5;
    return arrayOfDouble;
  }
  
  public void a(o paramo)
  {
    boolean bool = j.c;
    int m = j.b;
    if (!bool) {
      if (!e(paramo)) {
        return;
      }
    }
    float[] arrayOfFloat1 = new float[this.x * (this.x + 1) / 2];
    float[] arrayOfFloat2 = new float[this.x];
    a(arrayOfFloat1, arrayOfFloat2);
    double[][] arrayOfDouble = b(arrayOfFloat1, arrayOfFloat2);
    double[] arrayOfDouble1 = arrayOfDouble[0];
    double[] arrayOfDouble2 = arrayOfDouble[1];
    wc.a(paramo);
    double d1 = 0.0D;
    m localm = paramo.w();
    do
    {
      if (!localm.e()) {
        break;
      }
      d locald = localm.a();
      int i = locald.e().f();
      int j = locald.f().f();
      double d4 = arrayOfDouble1[i] - arrayOfDouble1[j];
      double d5 = arrayOfDouble2[i] - arrayOfDouble2[j];
      if (!bool)
      {
        if (m != 0) {
          break label195;
        }
        d1 += Math.sqrt(d4 * d4 + d5 * d5);
        localm.f();
      }
    } while (m == 0);
    label195:
    double d2 = 600.0D;
    if (!bool) {
      if (paramo.l() > 0) {
        d2 = d1 / paramo.l();
      }
    }
    double d3 = (bool) || (d2 > 0.0D) ? this.y / d2 : 1.0D;
    w localw = paramo.v();
    do
    {
      if (!localw.e()) {
        break;
      }
      int k = localw.d().f();
      paramo.a(localw.d(), arrayOfDouble1[k] * d3, arrayOfDouble2[k] * d3);
      localw.f();
      if ((!bool) && (m != 0)) {
        return;
      }
    } while (m == 0);
    if (!bool) {
      s();
    }
  }
  
  private boolean e(o paramo)
  {
    boolean bool = j.c;
    if ((bool) || (paramo != null))
    {
      if (bool) {
        break label40;
      }
      if (paramo.j() >= 1) {}
    }
    else
    {
      return false;
    }
    this.w = paramo;
    this.x = paramo.k();
    label40:
    return true;
  }
  
  private void s()
  {
    this.w = null;
    this.x = 0;
  }
  
  static final class a_
  {
    double a;
    double b;
  }
}


/* Location:           E:\idea\
 * Qualified Name:     a.f.g.c
 * JD-Core Version:    0.7.0.1
 */